/***************************************************************************
** @file:		ds18b20_dev.h
** @brief:  	
** @author:	
** @date:		2017-12-20
** @version: 	
***************************************************************************/
#ifndef __DS18B20_DEV_H__
#define __DS18B20_DEV_H__
#include "common.h"
#include "errno.h"


typedef struct
{
	void (*pfn_delay_us)(int us);
	void (*pfn_ds18b20_port_init)(void);
	void (*pfn_ds18b20_pin_cfg)(int  state);
	void (*pfn_ds18b20_pin_set)(int  state);
	uint8_t (*pfn_ds18b20_read_DIO)(void);
}ds18b20_drv_funcs_t;
 
typedef struct ds18b20_dev 
{
	const int id;
	uint8_t temp;
	const ds18b20_drv_funcs_t *p_funcs; 
	
} ds18b20_dev_t;

extern int ds18b20_init (ds18b20_dev_t * p_dev);
extern int ds18b20_get_temp (ds18b20_dev_t * p_dev,uint8_t* ptemp);

#endif  /*  __DS18B20_DEV_H__  */

